#include "CollisionSensor.hpp"
#include "Hardware.hpp"
#include "HardwareController.hpp"

CollisionSensor::CollisionSensor(Side aSide) :
	side(aSide)
{

}

/**
 * In absence of threads we'll have to poll each sensor manually
 * This method should only return true when the collision sensor is detecting a (possible) collision
 */
bool CollisionSensor::poll()
{
	if (side == FRONT)
		return Hardware::getHardwareController().pollCollisionSensorFront();
	else
		return Hardware::getHardwareController().pollCollisionSensorBack();
}

Sensor::SensorType CollisionSensor::getSensorType()
{
	return Sensor::COLLISION;
}

Side CollisionSensor::getSide()
{
	return side;
}
